let http = require("http")

let server = http.createServer(function (request, response) {

  console.log(request.method);
  console.log(request.url);


  response.writeHead(200, {
    "Content-Type": "text/html; charset=UTF-8",
    "KK": "9999"
    // "Content-Type": "application/json; charset=UTF-8"
  })
  let str = `
    <h1>HelloWorld 你好世界</h1>
    <p>你好世界</p>
  `
  // str =
  // {
  //   "name": "张三",
  // }

  // response.write(JSON.stringify(str));
  response.write(str);
  response.end()
})

server.listen(8080, function () {
  console.log("服务器已经启动, 监听端口号为8080");
})